const { DataTypes } = require('sequelize');
const { sequelize } = require('../config/database');

const UserCity = sequelize.define('UserCity', {
  user_id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    field: 'user_id'
  },
  city_id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    field: 'city_id'
  },
  is_default: {
    type: DataTypes.BOOLEAN,
    allowNull: false,
    defaultValue: false,
    field: 'is_default'
  }
}, {
  tableName: 'user_cities', // 明确指定表名为 user_cities
  timestamps: false // 关联表通常没有时间戳
});

module.exports = UserCity; 